package day07_class.src.com.itheima.test4;

public class Student {
    //成员变量
    private String name;
    private int age;
    public void setName(String name){
        this.name = name;
    }

    public String getName() {
        return name;
    }
    public void setAge(int age){
        if(age>0&&age<=110){
            this.age = age;
        }else{
            System.out.println("年龄有误");
        }
    }

    public int getAge() {
        return age;
    }

    //成员方法
    public void TestStudent(){
        System.out.println(name+"..."+age);
    }
}
